
<template>
    <div class="container">
        <h3>订单管理</h3>
            <el-row >

                <el-button type="primary"  style="float:right; margin-right: 10px"   @click="handleadded">新增订单</el-button>
            </el-row>

            <el-table
                :data="tableData1"
                border
                style="margin-top:20px;"
                ref="multipleTable"
                header-cell-class-name="table-header"
            >

                <el-table-column prop="ownerName" sortable label="客户名称"></el-table-column>
                <el-table-column prop="leadTime" sortable label="交付时间"></el-table-column>
				<el-table-column prop="positionName" sortable label="仓位号"></el-table-column>
				<el-table-column prop="shelvesName" sortable label="货架号"></el-table-column>
				<el-table-column prop="prodName" sortable label="交易品类"></el-table-column>
				<el-table-column prop="levelName" sortable label="品级"></el-table-column>
				<el-table-column prop="nums" sortable label="交易数量">
					<template slot-scope="scope">
						{{scope.row.nums}}kg
					</template>
				</el-table-column>
				<el-table-column prop="surplusNum" sortable label="剩余数量">
					<template slot-scope="scope">
						{{scope.row.surplusNum}}kg
					</template>
				</el-table-column>
				<el-table-column prop="money" sortable label="交易金额"></el-table-column>
                <el-table-column label="操作" width="150" align="center">
                    <template slot-scope="scope">
                        <el-button

                            type="text"
                            @click="handleEdit(scope.$index, scope.row)"
                        >编辑</el-button>
						<!-- <el-button
						    type="text"
						    @click="handleCheck(scope.$index, scope.row)"
						>查看</el-button> -->

                    </template>
                </el-table-column>
            </el-table>
            <el-pagination layout="total, prev, pager, next, jumper" :page-size="pagesize" :current-page.sync="currentPage1"  @current-change="handleCurrentChange1" :total="total1" style="margin-top:20px"></el-pagination>


    </div>
</template>

<script>
	import axios from "axios"

    export default {

        beforeRouteLeave(to, form, next) {
        next()
    },
        data() {
            return {
                currentPage1:1,
                pagesize:10,
                total1:0,
                tableData1: [],
            };
        },
        created(){


        },
        mounted(){
           this.getTableList();


        },

        methods: {
			// 获取 产品介绍列表数据
			getTableList(){
				let data = {
					page:this.currentPage1,
				}
				axios.post("http://47.108.220.160:90/jcApi/plant/control/storeOrder/findList",data).then((res)=>{
					this.tableData1 = res.data.rows
					this.total1 = res.data.total
				})
			},




          //  列表页书跳转
            handleCurrentChange1(val){
                this.currentPage1 = val
                this.getTableList()
            },

            handleClick(tab, event) {

            },

           // 进入新增页面
            handleadded(){
                this.$router.push({
                    path:'/morder/add',
                })
            },
			// 进入修改页面
            handleEdit(index,row){
				this.$router.push({
				    path:'/morder/edit',
					query:{ id:row.id }
				})
            },
           handleCheck(index,row){
           	this.$router.push({
           	    path:'/morder/check',
           		query:{ id:row.id }
           	})
           },



            handleSearch1() {
                this.currentPage1 = 1
                this.getTableList()
            },



        }
    }
</script>

<style scoped>
.upload-demo .el-upload--text{
    border: none;
    width: auto;
    height: auto;
    border-radius: 0;
    float: right;
    margin-right: 10px
}
.el-table{ margin-top: 20px;}
.el-pagination{
    text-align: center;
}
/* .el-row{ margin-bottom: 20px;} */
.el-pagination{
    text-align: center;
}
.el-col{
    margin-bottom:0;
}

</style>
